package com.agile.leetcode.concurrent.threadlocal;

import java.lang.reflect.Field;

/**
 * @Author:ChenZhangKun
 * @Date: 2021/11/25 11:46
 */
public class ThreadLocalHashCode {
    public static void main(String[] args) throws NoSuchFieldException, IllegalAccessException {
        for (int i = 0; i < 5; i++) {
            ThreadLocal<Object> objectThreadLocal = new ThreadLocal<>();
            Field threadLocalHashCode = objectThreadLocal.getClass().getDeclaredField("threadLocalHashCode");
            threadLocalHashCode.setAccessible(true);
            System.out.println("objectThreadLocal：" + threadLocalHashCode.get(objectThreadLocal));
        }
    }
}
